<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>安城金融图书管理平台</title>
		<link rel="stylesheet" href="${ pageContext.request.contextPath }/css/bootstrap.min.css" type="text/css" />
		<script src="${ pageContext.request.contextPath }/js/jquery-1.11.3.min.js" type="text/javascript"></script>
		<script src="${ pageContext.request.contextPath }/js/bootstrap.min.js" type="text/javascript"></script>
		<script src="http://g.alicdn.com/dingding/open-develop/1.6.9/dingtalk.js" type="text/javascript"></script>
		
		
		<script type="text/javascript">
		
		$(function(){ 
			
			dd.ready(function() {
			    dd.runtime.permission.requestAuthCode({
			        corpId: "ding830771a8e011eca6",
			        onSuccess: function(result) {
			       /*  {
			            code: 'hYLK98jkf0m' //string authCode
			        } */
			        var json= JSON.stringify(result);
					
					//alert(result.code);
        
			        
			        $("#code").val(result.code);
			        
			        var code = $("#code").val();
			        if(code != ""){
				//alert(code);
 				$.post("${ pageContext.request.contextPath }/DingServlet",{"method":"getUserId","code":code},function(data){
 					
 	 			}); 
 	 			
 				
 			}
			        
			        },
			        onFail : function(err) {}
			  
			    });
			});
			
			  
			
 			
			
			
			
		});
		
		</script>
	</head>

	<body>
		<div class="container-fluid">

			<%@ include file="menu.jsp" %>

			<!--
            	作者：ci2713@163.com
            	时间：2015-12-30
            	描述：轮播条
            -->
			<%-- <div class="container-fluid">
				<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
					<!-- Indicators -->
					<ol class="carousel-indicators">
						<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
						<li data-target="#carousel-example-generic" data-slide-to="1"></li>
						<li data-target="#carousel-example-generic" data-slide-to="2"></li>
					</ol>

					<!-- Wrapper for slides -->
					<div class="carousel-inner" role="listbox">
						<div class="item active">
							<img src="${ pageContext.request.contextPath }/img/1.jpg">
							<div class="carousel-caption">

							</div>
						</div>
						<div class="item">
							<img src="${ pageContext.request.contextPath }/img/2.jpg">
							<div class="carousel-caption">

							</div>
						</div>
						<div class="item">
							<img src="${ pageContext.request.contextPath }/img/3.jpg">
							<div class="carousel-caption">

							</div>
						</div>
					</div>

					<!-- Controls -->
					<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
						<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
						<span class="sr-only">Previous</span>
					</a>
					<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
						<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
						<span class="sr-only">Next</span>
					</a>
				</div>
			</div> --%>
			<!--
            	作者：ci2713@163.com
            	时间：2015-12-30
            	描述：商品显示
            -->
			<div class="container-fluid">
			<input type="hidden" id="code" name="code">
				<div class="col-md-12">
					<h2>最新图书&nbsp;&nbsp;<img src="${ pageContext.request.contextPath }/img/title2.jpg"/></h2>
				</div>
				
				<div class="col-md-10">
					
					<c:forEach var="p" items="${ newList }">
					<div class="col-md-2" style="text-align:center;height:200px;padding:10px 0px;">
						<a href="${ pageContext.request.contextPath }/BookServlet?method=findByBook_id&book_id=${ p.book_id}">
							<img src="${ pageContext.request.contextPath }/${ p.book_image}" width="130" height="130" style="display: inline-block;">
						</a>
						<p><a href="${ pageContext.request.contextPath }/BookServlet?method=findByBook_id&book_id=${ p.book_id}" style='color:#666'>${ p.book_name }</a></p>
						<p><font color="#E4393C" style="font-size:16px"><a href="${ pageContext.request.contextPath }/BookServlet?method=findByBook_id&book_id=${ p.book_id}">库存：${ p.inventory }</a></font></p>
					</div>
					</c:forEach>
	
				</div>
			</div>
			<!--
            	作者：ci2713@163.com
            	时间：2015-12-30
            	描述：广告部分
            -->
            <div class="container-fluid">
				<img src="${ pageContext.request.contextPath }/products/hao/ac.jpg" width="100%"/>
			</div>
			<!--
            	作者：ci2713@163.com
            	时间：2015-12-30
            	描述：商品显示
            -->
			<div class="container-fluid">
				<div class="col-md-12">
					<h2>热门图书&nbsp;&nbsp;<img src="${ pageContext.request.contextPath }/img/title2.jpg"/></h2>
				</div>
				
				<div class="col-md-10">
					
				
					<c:forEach var="p" items="${ hotList }">
					<div class="col-md-2" style="text-align:center;height:200px;padding:10px 0px;">
						<a href="${ pageContext.request.contextPath }/BookServlet?method=findByBook_id&book_id=${ p.book_id}">
							<img src="${ pageContext.request.contextPath }/${ p.book_image}" width="130" height="130" style="display: inline-block;">
						</a>
						<p><a href="${ pageContext.request.contextPath }/BookServlet?method=findByBook_id&book_id=${ p.book_id}" style='color:#666'>${ p.book_name }</a></p>
						<p><font color="#E4393C" style="font-size:16px"><a href="${ pageContext.request.contextPath }/BookServlet?method=findByBook_id&book_id=${ p.book_id}">库存：${ p.inventory }</a></font></p>
					</div>
					</c:forEach>
					
				</div>
			</div>			
			<!--
            	作者：ci2713@163.com
            	时间：2015-12-30
            	描述：页脚部分
            -->
			<div class="container-fluid">
				<%@ include file="under.jsp" %>
			</div>
		</div>
	</body>

</html>